home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
answrbok
/
7_10.lha
/
7_10
/
qh_cut.c
< prev
next >
Wrap
Text File
|
1993-08-08
|
949b
|
32 lines
* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
* The C++ Answer Book */
* Tony Hansen */
* All rights reserved. */
include <process.h>
include <debug.h> /* DELETE */
/ Change
/ old_queue_head -- old_queue -- old_queue_tail
/ into
/ old_queue_head -- new_queue
/ new_queue_head -- old_queue -- old_queue_tail
/ where old_queue_head == this
/ Return new_queue_head.
ueue_head *queue_head::cut()
if (debug) /*DELETE*/ cerr << "queue_head" << this << "::cut()\n";
process_queue *oldQ = qh_queue;
queue_head *new_head = new queue_head(qh_mode, oldQ->q_max);
process_queue *newQ = new_head->qh_queue;
// put the new head on the old queue
oldQ->q_head = new_head;
new_head->qh_queue = oldQ;
// put the old head on the new queue
qh_queue = newQ;
newQ->q_head = this;
if (debug) /*DELETE*/ cerr << "<<<< queue_head" << this << "::cut() <- " << new_head << "\n";
return new_head;